using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Threading;
using System.Globalization;
using Fan.Dongping.Common;

/// <summary>
/// Summary description for PageBase
/// </summary>
public class PageBase : System.Web.UI.Page
{

    protected Languages Language
    {
        get
        {
            Languages language = Languages.zh_CH;
            if (Session["Culture"] != null)
            {
                string UserCulture = Session["Culture"] as string;

                if (UserCulture.Contains("en"))
                {
                    language = Languages.en_US;
                }
            }
            return language;
        }
        //set { language = value; }
    }

    protected override void InitializeCulture()
    {
        if (Session["Culture"] != null)
        {
            string UserCulture = Session["Culture"] as string;

            Thread.CurrentThread.CurrentUICulture = new CultureInfo(UserCulture);
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(UserCulture);
        }

    }
}
